package lesson08;

public class Metranic {
    public void serviceForCar(Serviceable serviceable){
        serviceable.turnupEngine();
        serviceable.changeOil();
    }
    public void serviceForNewEngineCar(ServiceNewEngine serviceNewEngine){
        serviceNewEngine.serviceBerria();
    }

    public static void main(String[] args) {
        Metranic metranic = new Metranic();
        metranic.serviceForCar(new Auto());
        metranic.serviceForCar(new Ferria());
        metranic.serviceForNewEngineCar(new Tesla());
        LXOne lxOne = new LXOne();
        metranic.serviceForCar(lxOne);
        metranic.serviceForNewEngineCar(lxOne);

        System.out.println(ServiceNewEngine.name);

        Auto auto = new Auto();
        auto.drive();

        Ferria ferria = new Ferria();
        ferria.drive();
//        高内聚，低耦合
    }
}
